<br>
<!--<h3 style="font-size: 20px;">参与评论</h3>-->
<style>
    .media-object, .avatar {
        border-radius: 50%;
    }
    .tips_error {
        margin-left: -40px;
        text-align: center;
    }
</style>
<div class="comment-area" id="comments">

    <form class="form-horizontal comment-form" action="{:U('comment/comment/post')}" method="post">
        <div class="control-group">
            <div class="comment-postbox-wraper">
                <textarea class="form-control comment-postbox" placeholder="请登录后参与评论…" style="min-height:90px;width: 732px;border-radius: 10px 10px 10px 10px;
    border: 1px solid #707070;" name="content"></textarea>
            </div>
        </div>

        <div class="control-group"
             style="margin-top: -20px;border-radius: 10px 10px 10px 10px;width: 756px;font-size: 15px;">
            <span style="margin: 0 auto;display: block;width: 60px;height: 30px;margin: 0 auto!important;margin-top: 12px!important;">
                <!--<a href="{:U('article/do_login',array('id'=>$article_id))}" class="js-count-btn">-->
                    <!--登录-->
                <!--</a>-->
            <!--</span><span style="color: #686568;">后参与评论</span>-->
            <button  style="border-radius: 10px;
            background-color: #000232;
            color: #fff;
            font-size: 18px;
            width: 60px;
            height: 30px;
            display: inline;
            margin:0 auto;
            border:#707070;
            line-height: 16px;" type="submit" class="btn  btn-primary js-ajax-submit hide">
                评论
            </button>
        </div>

        <input type="hidden" name="post_title" value="{$params.post_title}"/>
        <input type="hidden" name="post_table" value="{$post_table}"/>
        <input type="hidden" name="post_id" value="{$post_id}"/>
        <input type="hidden" name="to_uid" value="0"/>
        <input type="hidden" name="parentid" value="0"/>
    </form>

    <script class="comment-tpl" type="text/html">
        <div class="comment" data-username="{$user_nicename}" data-uid="{$id}">
            <a class="pull-left" href="{:U('user/index/index',array('id'=>$id))}">
                <img style="border-radius: 50%!important;" class="media-object avatar" src="{:sp_get_user_avatar_url($avatar)}?t={:time()}"
                     class="headicon"/>
            </a>
            <div class="comment-body">
                <div class="comment-content"><a href="{:U('user/index/index',array('id'=>$id))}">{$user_nicename}</a>:<span
                        class="content"></span></div>
                <div><span class="time">刚刚</span> <a onclick="comment_reply(this);" href="javascript:;"><i
                        class="fa fa-comment"></i></a></div>
            </div>
            <div class="clearfix"></div>
        </div>
    </script>

    <script class="comment-reply-box-tpl" type="text/html">
        <div class="comment-reply-submit">
            <div class="comment-reply-box">
                <input type="text" class="textbox" placeholder="回复">
            </div>
            <button class="btn pull-right" onclick="comment_submit(this);">回复</button>
        </div>
    </script>



    <div class="comments">
        <foreach name="comments" item="vo">
            <div class="comment" data-id="{$vo.id}" data-uid="{$vo.uid}" data-username="{$vo.full_name}"
                 id="comment{$vo.id}">
                <a class="pull-left" href="{:U('user/index/index',array('id'=>$vo['uid']))}">
                    <img class="media-object avatar" src="{:U('user/public/avatar',array('id'=>$vo['uid']))}"
                         class="headicon"/>
                </a>
                <div class="comment-body">
                    <div class="comment-content"><a href="{:U('user/index/index',array('id'=>$vo['uid']))}">{$vo.full_name}</a>:<span>{$vo.content}</span>
                    </div>
                    <div>
                        <span class="time">{:date('m月d日  H:i',strtotime($vo['createtime']))}</span>
                        <a onclick="comment_reply(this);" href="javascript:;"><i class="fa fa-comment"></i></a>
                    </div>

                    <if condition="!empty($vo['children'])">
                        <foreach name="vo.children" item="voo">
                            <div class="comment" data-id="{$voo.id}" data-uid="{$voo.uid}"
                                 data-username="{$voo.full_name}" id="comment{$voo.id}">
                                <a class="pull-left" href="{:U('user/index/index',array('id'=>$voo['uid']))}">
                                    <img class="media-object avatar"
                                         src="{:U('user/public/avatar',array('id'=>$voo['uid']))}" class="headicon"/>
                                </a>
                                <div class="comment-body">
                                    <div class="comment-content">
                                        <a href="{:U('user/index/index',array('id'=>$voo['uid']))}">{$user_nicename|default=$user_login}</a>:
                                        <span>
                                            回复 <a href="{:U('user/index/index',array('id'=>$voo['to_uid']))}">{$parent_comments[$voo['parentid']]['full_name']}</a>
                                            {$voo.content}
                                        </span>
                                    </div>
                                    <div>
                                        <span class="time">{:date('m月d日  H:i',strtotime($voo['createtime']))}</span>
                                        <a onclick="comment_reply(this);" href="javascript:;">
                                            <i class="fa fa-comment"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </foreach>
                    </if>
                </div>
                <div class="clearfix"></div>
            </div>
        </foreach>
    </div>

</div>
<script>
    $(function () {
        $(".hide").click(function () {
            setTimeout(hide,800);
            function hide() {
                $(".tips_error").fadeOut();
            }
        });
    })
</script>
